﻿@model Services.Schedules
@{
    ViewBag.Title = "ApproveSchedule";
    Layout = "~/_Layout.cshtml";
}
<style type="text/css">
    .schedule_content {
        width: 400px;
        height: 100px;
    }
</style>
<h2>ApproveSchedule</h2>
@using (Html.BeginForm("ApproveAction", "Schedule", FormMethod.Post, new { @schedule = Model }))
{
    @Html.HiddenFor(p => p.Id)
    <div>
        <table class="tab">
            <tr>
                <td colspan="2" style="font-weight: bold">查看我的已提交计划</td>
            </tr>
            <tr>
                <td>标题:</td>
                <td>@Html.TextBoxFor(p => p.Title)</td>
            </tr>
            <tr>
                <td>提交内容:</td>
                <td>
                    @Html.TextAreaFor(p => p.Contents, new { @class = "schedule_content" })
                </td>
            </tr>
            <tr>
                <td>提交时间:</td>
                <td>
                    @Html.TextBoxFor(p => p.BeginDate)
                </td>
            </tr>
            <tr>
                <td>发送人:</td>
                <td>
                    @Html.TextBoxFor(p => p.SendUid)
                </td>
            </tr>
            <tr>
                <td>审核人:</td>
                <td>
                    @Html.TextBoxFor(p => p.ApproveUid)
                </td>
            </tr>
            <tr>
                <td>状态:</td>
                <td>
                    @Html.TextBoxFor(p => p.Status)
                </td>
            </tr>
            <tr>
                <td>审核内容:</td>
                <td>
                    @Html.TextAreaFor(p => p.ApproveContent, new { @class = "schedule_content" })
                </td>
            </tr>
            <tr style="display: none;">
                <td>审核时间:</td>
                <td>
                    @Html.TextBoxFor(p => p.ApproveDate)
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" value="通过" id="btn_approve" class="btn" />
                    <input type="submit" value="退回" id="btn_refuse" class="btn" />
                    <input id="btn_back" type="button" class="btn" value="返回" />
                </td>
            </tr>
        </table>
    </div>
}
<script type="text/javascript">
    $(function () {
        $("#div_content input[type=text]").each(function () {
            $(this).attr("readonly", "readonly");
        })

        $("#div_content textarea").each(function () {
            $(this).attr("readonly", "readonly");
        })
    })


    $("#btn_back").click(function () {
        window.location.href = "/Schedule/MyScheduleList";
    })

    $("#btn_refuse").click(function () {
        var url = '@Url.Action("RefuseSchedule", "Schedule")'
        $("form").attr("action", url);
    })
</script>
